//package top.zhmq.orderconsumer.config;
//
//import org.springframework.amqp.core.Binding;
//import org.springframework.amqp.core.BindingBuilder;
//import org.springframework.amqp.core.CustomExchange;
//import org.springframework.amqp.core.Queue;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// *
// *
// * @author Glory
// * @classname RabbitConfig
// * @create 2021-06-08 10:35
// */
//
//@Configuration
//public class RabbitConfig {
//    /**
//     * 订单取消
//     */
//    @Bean
//    public CustomExchange delayExchange() {
//        Map<String, Object> args = new HashMap<>();
//        args.put("x-delayed-type", "direct");
//        return new CustomExchange("delayed_exchange", "x-delayed-message", true, false, args);
//    }
//
//    @Bean
//    public Queue queue() {
//        Queue queue = new Queue("delay_queue_1", true);
//        return queue;
//    }
//
//    @Bean
//    public Binding binding() {
//        return BindingBuilder.bind(queue()).to(delayExchange()).with("delay_queue_1").noargs();
//    }
//
//}